<script setup>
import {computed, inject} from "vue"

const props = defineProps({
    table: {
        type: Object,
    },
    elem: {
        type: Object,
    },
    apiData: {
        type: Object,
    },
    rowspan: {
        type: Number,
        default: 1,
    }
})

/**
 * 列样式
 * @returns {*&{fontSize, fontWeight, color}}
 */
const columnStyle = computed(() => {
    return {
        ...props.table.columnStyleConfig,
        ...props.elem.styleConfig,
    }
})

</script>

<template>
    <td :style="columnStyle" :rowspan="rowspan">
        <component is="Text1" v-for="cell in elem.children" :key="cell.id" :elem="cell" :apiData="apiData"></component>
    </td>
</template>

<style lang="scss" scoped>
td {
    position: relative;
    border: 1px solid #ddd;
}
</style>